import time
from inspect import signature


def timethis(func):
    """
    Decorator that reports the execution time.
    :param func:
    :return:
    """
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(func.__name__, end - start)
        return result
    return wrapper


if '__main__' == __name__:

    @timethis
    def countdown(n: int):
        '''
        Counts down
        :param n: number of seconds to count down.
        :return: None
        '''
        while n > 0:
            n -= 1

    print(countdown.__name__)
    print(countdown.__doc__)
    print(countdown.__annotations__)
    # print(countdown.__wrapped__)  # AttributeError: 'function' object has no attribute '__wrapped__'
    print(signature(countdown))
    countdown(1e5)
    countdown(1e7)
